/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.vsu.model;

import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import ru.vsu.domain.Lot;
import ru.vsu.service.LotService;

/**
 *  Бин, показывающий действующие аукционы.
 *
 * @author Roman Velichkin <vrnroman@gmail.com>
 */
@Named(value="lotsExplorer")
@SessionScoped
public class LotsExplorer implements Serializable {

    @EJB
    private LotService lotService;

    @Inject
    private transient ThingBean thingBean;

    private Lot selectedLot;

    public List<Lot> getActiveLots() {
        return lotService.getActiveLots();
    }

    public Lot getSelectedLot() {
        return selectedLot;
    }

    public void setSelectedLot(Lot selectedLot) {
        this.selectedLot = selectedLot;
    }

    public String goToThingPage() {
        return "thing.xhtml?faces-redirect=true";
    }


    /** Creates a new instance of LotsExplorer */
    public LotsExplorer() {
    }

}
